/**
 * 文件名：SkuRealtimeInventory.java
 *
 * 创建人：Elvin Zhao - 279152260@qq.com
 *
 * 创建时间：2019年1月28日 下午4:06:49
 *
 * 版权所有：FNII
 */
package com.z100h.supplychain.statistics.entity;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang3.StringUtils;

import com.jeeplus.core.persistence.DataEntity;

/**
 * [描述信息：说明类的基本功能]
 *
 * @author Elvin Zhao - 279152260@qq.com
 * @version 1.0 Created on 2019年1月28日 下午4:06:49
 */
public class SkuRealtimeInventory extends DataEntity<SkuRealtimeInventory> {

	private static final long serialVersionUID = 1L;

	private String name;

	private String categoryStr;

	private Integer amount;

	private List<SkuRealtimeInventory> skuRealtimeInventoryList;

	public String getCategoryStr() {
		return categoryStr;
	}

	public void setCategoryStr(String categoryStr) {
		this.categoryStr = categoryStr;

		if (null != categoryStr) {
			skuRealtimeInventoryList = new ArrayList<SkuRealtimeInventory>();
			String[] categoryAmountArr = StringUtils.split(categoryStr, "|");
			for (String categoryAmount : categoryAmountArr) {
				String[] categoryArr = StringUtils.split(categoryAmount, "*");
				SkuRealtimeInventory inventory = new SkuRealtimeInventory();
				inventory.setName(categoryArr[0]);
				inventory.setAmount(Integer.valueOf(categoryArr[1]));
				skuRealtimeInventoryList.add(inventory);
			}
		}
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getAmount() {
		return amount;
	}

	public void setAmount(Integer amount) {
		this.amount = amount;
	}

	public List<SkuRealtimeInventory> getSkuRealtimeInventoryList() {
		return skuRealtimeInventoryList;
	}

	public void setSkuRealtimeInventoryList(List<SkuRealtimeInventory> skuRealtimeInventoryList) {
		this.skuRealtimeInventoryList = skuRealtimeInventoryList;
	}

	public SkuRealtimeInventory() {
	}

}
